<{area inject='.mainHead'}>
<div class="notice">
<{t}>请输入国家,国家区号,电话号位数<{/t}><br>
</div>

<div class="gridlist-action mainHead">
<div style="padding:0 1px; float:left; ">
<{button type="button" class="btn-has-icon" label=$___b2c="新增手机号"|t:'b2c' app="desktop"  icon="btn_add.gif" onclick="addNewRow();"}>
</div>
</div>
<div class='headBox mainHead' style="clear:both">
 <div class='headContent'>
   <div class='gridlist-head' style="border-bottom:1px solid #ddd">
		<div class='span-8' style='text-align:center'><{t}>国家名<{/t}></div>
        <div class='span-8' style='text-align:center'><{t}>国家区号<{/t}></div>
		<div class='span-8' style='text-align:center'><{t}>电话位数<{/t}></div>
        <div  class='span-3'><{t}>删除<{/t}></div>
   </div>
 </div>
</div>
<{/area}>
<form action="index.php?app=b2c&ctl=admin_member&act=save_phone" id="attrEditor_bag" method="post" >
<div class='finder' id='website_unit' >
    <{if $unit_arr}>
    <{foreach from=$unit_arr item=phone}>
    <div class="row">
        <div class="row-line">
            <div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8">
                <input style='margin-left:50px;width:100px;' type="text"  name="country[]" value="<{$phone.country}>" class="x-input inputstyle" autocomplete="off" vtype="required">
            </div>
			<div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8">
                <input style='margin-left:50px;width:100px;' type="text"  name="area[]" value="<{$phone.area}>" class="x-input inputstyle" autocomplete="off"  vtype="required&&digits&&number" >
				<span class="msg"></span>
            </div>
			<div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8">
                <input style='margin-left:50px;width:100px;' type="text"  name="length[]" value="<{$phone.length}>" class="x-input inputstyle" autocomplete="off" vtype="required&&digits&&number" >
            </div>
            <div style="text-align:center; margin-top:6px" class="span-3 "><span style="cursor:pointer" onclick="deleteRow(this);">
            <img border="0" alt="删除" src="<{$env.BASE_URL}>/public/app/b2c/statics/bundle/delecate.gif"></span>
            </div>
        </div>
    </div>
    <{/foreach}>
    <{else}>
    <div class="row">
        <div class="row-line">
            <div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8">
                <input style='margin-left:50px;width:100px;' type="text"  name="country[]" class="x-input inputstyle" autocomplete="off" vtype="required">
            </div>
			<div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8">
                <input style='margin-left:50px;width:100px;' type="text"  name="area[]" class="x-input inputstyle" autocomplete="off" vtype="required&&digits&&number">
				<span class="msg"></span>
            </div>
			<div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8">
                <input style='margin-left:50px;width:100px;' type="text" name="length[]" class="x-input inputstyle" autocomplete="off" vtype="required&&digits&&number">
            </div>
            <div style="text-align:center; margin-top:6px" class="span-3 "><span style="cursor:pointer" onclick="deleteRow(this);">
            <img border="0" alt="删除" src="<{$env.BASE_URL}>/public/app/b2c/statics/bundle/delecate.gif"></span>
            </div>
        </div>
    </div>
    <{/if}>
</div>
</form>

<{area inject='.mainFoot'}>
  <div class="mainFoot">
    <div class="footer">
    <div class="table-action" style="margin-top:10px; background:none">
	<{button label=$___b2c="保存"|t:'b2c' type="button" onclick="$('attrEditor_bag').fireEvent('submit',new Event(event))" id="btn1"}>
   </div>
    </div>
  </div>
<{/area}>

<script>
	function addNewRow(){
		var $html='<div class="row-line"><div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8"><input style="margin-left:50px;width:100px;" type="text"  name="country[]" class="x-input inputstyle" autocomplete="off"  vtype="required"></div><div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8"><input style="margin-left:50px;width:100px;" type="text"   name="area[]" class="x-input inputstyle" autocomplete="off"  vtype="required&&digits&&number"><span class="msg"></span></div><div style="margin-top:5px;margin-bottom:5px; height:25px; line-height:25px" class="span-8"><input style="margin-left:50px;width:100px;" type="text"  name="length[]" class="x-input inputstyle" autocomplete="off" vtype="required&&digits&&number"></div><div style="text-align:center; margin-top:6px" class="span-3 "><span style="cursor:pointer" onclick="deleteRow(this);"><img border="0" alt="删除" src="<{$env.BASE_URL}>/public/app/b2c/statics/bundle/delecate.gif"></span></div></div>';
		new Element('div').addClass('row').set('html',$html).inject($('website_unit'));
	}
	function deleteRow(obj){
		if(confirm('确认要删除吗？')){$(obj).getParent('.row').destroy();}return false;
	}
</script>